package com.zmj.sy.mom.srv.aps.controller;

import com.zmj.sy.mom.srv.aps.bean.dto.GroupUser.GroupUserDto;
import com.zmj.sy.mom.srv.aps.bean.dto.PartType.PartTypeDto;
import com.zmj.sy.mom.srv.aps.bean.dto.staff.StaffDto;
import com.zmj.sy.mom.srv.aps.bean.vo.base.*;
import com.zmj.sy.mom.srv.aps.bean.vo.group.*;
import com.zmj.sy.mom.srv.aps.bean.vo.partType.PartTypeSelectVo;
import com.zmj.sy.mom.srv.aps.bean.vo.partType.PartTypeVo;
import com.zmj.sy.mom.srv.aps.service.GroupService;
import com.zmj.sy.mom.srv.aps.service.GroupUserService;
import com.zmj.sy.mom.srv.aps.service.PartTypeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RequiredArgsConstructor
@Api(tags = "物料类型")
@RestController
@RequestMapping("/partType")
public class PartTypeController {


    private final PartTypeService partTypeService;

    @ApiOperation("新增物料类型")
    @PostMapping("/add")
    public BaseResVo add(@RequestBody PartTypeDto reqVo){
        partTypeService.add(reqVo);
        return BaseResVo.ok();
    }


    @ApiOperation("修改物料类型")
    @PostMapping("/edit")
    public BaseResVo edit(@RequestBody PartTypeDto reqVo){
        partTypeService.edit(reqVo);
        return BaseResVo.ok();
    }



    @ApiOperation("删除物料类型")
    @PostMapping("/delete")
    public BaseResVo delete(Integer id){
        partTypeService.delete(id);
        return BaseResVo.ok();
    }



    @ApiOperation("物料类型列表")
    @GetMapping("/list")
    public BasePageResVo<PartTypeDto> list(PartTypeSelectVo partTypeVo){
        return partTypeService.list(partTypeVo);
    }

}
